package com.cooper.mediadb.online;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.cooper.scrapemedialib.R;

import android.widget.ListAdapter;
import android.widget.SimpleAdapter;

public class MediaSrcSelectLogoDialog extends MediaSrcSelectDialog{

	@Override
	protected ListAdapter getListAdapter(List<MediaSource> sources) {
		ArrayList<HashMap<String, Object>> srcList = new ArrayList<HashMap<String, Object>>();
		for (MediaSource src : sources) {

			HashMap<String, Object> srcData = new HashMap<String, Object>();

			srcData.put("src_icon", src.getLogoResId());
			srcList.add(srcData);

		}

		return new SimpleAdapter(getActivity(),
				srcList, R.layout.media_src_logo_item,
				new String[] { "src_icon" }, new int[] { R.id.src_icon });
	}

	@Override
	protected int getLayoutRes() {
		return R.layout.media_src_logo_select;
	}

}
